<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>layui</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all" />
		<link rel="stylesheet" href="__CSS__/admin.css" media="all">
	</head>
	<style>
		.layui-word-aux {
			color: #2BB6F6!important;
		}
	</style>

	<body style="padding:10px;">
		<div class="layui-form-item" style="overflow:auto;">
			<!--<div class="layui-form-item" style="float: left;">
				<div class="layui-input-inline">
					<label class="layui-form-label">房券余次 <span style="margin-left: 10px;color: #2BB6F6!important;">1</span></label>
				</div>
				<div class="layui-input-inline">
					<label class="layui-form-label">本次新增 <span style="margin-left: 10px;color: #2BB6F6!important;">1</span></label>
				</div>
			</div>-->
			<form class="layui-form" id="mem">
				{volist name="$info" id="v"} 
				<div class="layui-form-item" style="float: left;margin-left: -10px;">
					<div class="layui-input-inline">
						<label class="layui-form-label">{$v.room_name} <span>{$v.num}</span></label>
					</div>
					<label class="layui-form-label">本次新增</label>
					<div class="layui-input-inline">
						<input name="num[]" autocomplete="off" class="layui-input" type="text">
					</div>
				</div>
				<input type="hidden" name="id[]" value="{$v.id}"/> 
				<input type="hidden" name="user_id" value="{$v.user_id}"/> 
				{/volist}
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button class="layui-btn" lay-submit lay-filter="btn">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
			</form>

			<script src="__PUBLIC__/layui/layui.js"></script>
			<script src="__PUBLIC__/jquery/jquery.min.js"></script>
			<script>
				layui.use(['layer', 'form'], function() {
					var layer = layui.layer,
						$ = layui.jquery,
						form = layui.form;
					$(window).on('load', function() {
						form.on('submit(btn)', function(data) {
							$.ajax({
								url: "{:url('admin/member/faedit')}",
								data: $('#mem').serialize(),
								type: 'post',
								async: false,
								success: function(res) { 
									if(res.code == 1) {
										layer.msg(res.msg, function(index) {
											window.parent.location.reload(); 
											location.href = res.url;
										})
									} else {
										layer.msg(res.msg);
									}
								}
							})
							return false;
						});
					});
				});
			</script>
		</div>
	</body>

</html>